package com.butang.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * ClassName: Result
 * Package: com.butang.pojo
 * Description:
 *
 * @Author BuTang
 * @Create 2023/7/9 23:29
 * @Version 1.0
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {
    private Integer code ;
    private String msg;
    private Object data;

    //增删改响应成功
    public static Result success(){
        return new Result(1,"success",null);
    };

    //查询响应成功
    public static Result success(Object data){
        return new Result(1,"success",data);
    }

    public static Result error(String msg){
        return new Result(0,msg,null);
    }
}
